﻿using UnityEngine;
using System.Collections;

public class DelMySelfByTime : MonoBehaviour {
    float timetick = 0;
    float showTime = 5;
    // Use this for initialization
    void Start () {

    }

    protected void OnEnable()
    {
        timetick = 0;
    }

    // Update is called once per frame
    void Update () {
        timetick += Time.deltaTime;

        if (showTime <= timetick)
        {
            Destroy(gameObject);
        }
    }
}
